#include <iostream>
#include <cstring> 
using namespace std;

int main() {
    int a;
    char e[101];
    cin >> a; 
    cin.ignore();
    cin.getline(e, 101); 
    int len = strlen(e); 
    a = a % len;
    char r[201] = {0}; 
    strcpy(r, e + a); 
    int le=len-a;
    for (int i = 0; i < a; i++) {
	        r[le] = e[i]; 
	        le++; }
	r[len + 1] = '\0'; 
    cout << r << endl; 
    return 0;

}


